package mk.Compare;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashMap;

public class WorkspaceStructure {

    public static void main(String[] args) {
        HashMap<String, String> result = createTree(new HashMap<String, String>(), "C:\\Users\\mkiryluk\\Desktop\\AXA");
        for (String key : result.keySet()) {
            String value = result.get(key);
            System.out.println(key + " = " + value);
        }

    }

    public static HashMap<String, String> createTree(HashMap<String, String> workspaceStructure, String parent) {

        File[] f;
        f = (new File(parent)).listFiles();

        workspaceStructure.put(parent, "");
        // System.out.println(parent);


        for (int i = 0; i < f.length; i++) {

            if (f[i].isFile()) {
                //System.out.println(parent + "\\" + f[i].getName());
                workspaceStructure.put(parent, f[i].getName());
            } else {

                createTree(workspaceStructure, parent + "\\" + f[i].getName());
            }
        }

        return workspaceStructure;
    }
}
